]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st-shadow: Fix offset shadow offscreen rendering
authorLionel Landwerlin <llandwerlin@gmail.com>
Tue, 7 May 2013 22:35:27 +0000 (23:35 +0100)
committerLionel Landwerlin <llandwerlin@gmail.com>
Wed, 8 May 2013 15:17:02 +0000 (16:17 +0100)
The shadows are currently rendered by painting the actor we want to
apply shadow on, in an offscreen buffer. The problem is that when this
actor has an allocation padding (ie allocation that isn't at 0x0
relatively to its parent), this padding is added within the offscreen
buffer and as a result the shadow rendering is truncated because the
offscreen buffer size is the size of the allocation box, not the
allocation box + padding.

This patch reposition the actor at 0x0 with rendering it by changing
the initial transformation matrix when rendering the actor offscreen.

https://bugzilla.gnome.org/show_bug.cgi?id=698301

src/st/st-icon.c
src/st/st-label.c
src/st/st-private.c
src/st/st-shadow.c

index 3fec7e2a28a1d0979e5350fe059f933b52404207..fac474af99efa635c8717a77237583a3175807a5 100644 (file)
@@ -249,11 +249,6 @@ st_icon_paint (ClutterActor *actor)
           clutter_actor_get_allocation_box (priv->icon_texture, &allocation);
           clutter_actor_box_get_size (&allocation, &width, &height);
 
-          allocation.x1 = (width - priv->shadow_width) / 2;
-          allocation.y1 = (height - priv->shadow_height) / 2;
-          allocation.x2 = allocation.x1 + priv->shadow_width;
-          allocation.y2 = allocation.y1 + priv->shadow_height;
-
           _st_paint_shadow_with_opacity (priv->shadow_spec,
                                          priv->shadow_material,
                                          &allocation,
index 4954d493735e1ea93164b07a648d274b400aca51..9833b8337edf072f0198399c169bf4e1744d48fe 100644 (file)
@@ -218,10 +218,6 @@ st_label_paint (ClutterActor *actor)
       clutter_actor_get_allocation_box (priv->label, &allocation);
       clutter_actor_box_get_size (&allocation, &width, &height);
 
-      allocation.x1 = allocation.y1 = 0;
-      allocation.x2 = width;
-      allocation.y2 = height;
-
       if (priv->text_shadow_material == COGL_INVALID_HANDLE ||
           width != priv->shadow_width ||
           height != priv->shadow_height)
index 793202b78ffbf1af5d0ca197277faef38040529d..45e909624a95cb4f88db48eb78853753a92a3121 100644 (file)
@@ -511,6 +511,7 @@ _st_create_shadow_material_from_actor (StShadow     *shadow_spec,
       cogl_color_set_from_4ub (&clear_color, 0, 0, 0, 0);
       cogl_push_framebuffer (offscreen);
       cogl_clear (&clear_color, COGL_BUFFER_BIT_COLOR);
+      cogl_translate (-box.x1, -box.y1, 0);
       cogl_ortho (0, width, height, 0, 0, 1.0);
       clutter_actor_paint (actor);
       cogl_pop_framebuffer ();
index df1787f996efe18ae66ae9c8bb1a9ff723095e98..4a2ff001dc98a161d32c32135f5405ee6f7723f3 100644 (file)
@@ -292,11 +292,6 @@ st_shadow_helper_paint (StShadowHelper  *helper,
 
   clutter_actor_box_get_size (actor_box, &width, &height);
 
-  allocation.x1 = (width - helper->width) / 2;
-  allocation.y1 = (height - helper->height) / 2;
-  allocation.x2 = allocation.x1 + helper->width;
-  allocation.y2 = allocation.y1 + helper->height;
-
   _st_paint_shadow_with_opacity (helper->shadow,
                                  helper->material,
                                  &allocation,